import type { FormRules } from 'element-plus'
export interface RouleForm {
    name:string,
    phoneNum:string,
    verificationCode:string,
    shopType:string,
    shopNum: string,
    isChecked: string[]
}

export interface shopTypeDataType {
    title:string,
    code: string
}

export interface dataType <T> {
    value: T[]
}


// 定义表单的校验规则
export const RouleFormData:FormRules<RouleForm> = {
    name: [
        { required: true, message: '请输入名字', trigger: 'blur' },
   ],
   phoneNum: [
     { required: true, message: '请输入手机号码', trigger: 'blur' },
     { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码格式', trigger: 'blur' },
     //  { validator: this.validatePassword, trigger: 'blur' }
   ],
   verificationCode: [
     { required: true, message: '请输入校验码', trigger: 'blur' },
   ],
   shopType: [
     { required: true, message: '请选择店铺类型', trigger: 'blur' },
   ],
   shopNum: [
     { required: true, message: '请输入店铺数量', trigger: 'blur' },
     { pattern:/^[1-9]\d*$/ , message: '只能输入数量', trigger: 'blur' },
   ],
   isChecked: [
     {
       type: 'array',
       required:true,
       message: '请阅读并同意《个人信息授权与隐私政策》',
       trigger: 'change',
     }
   ]
}
